package com.ny.service.impl;

import com.ny.dao.ProductDao;
import com.ny.dao.impl.ProductDaoImpl;
import com.ny.entity.Product;
import com.ny.service.ProductService;

import java.sql.SQLException;
import java.util.List;

public class ProductServiceImpl implements ProductService
{
    private ProductDao productDao = new ProductDaoImpl();

    public ProductServiceImpl() throws SQLException, ClassNotFoundException {
    }


    @Override
    public List<Product> findAllProduct() throws SQLException {

        return productDao.findAllProduct();
    }

    @Override
    public int addProduct(Product product) throws SQLException {
        return 0;
    }

    @Override
    public Product updateProduct(Product product) throws SQLException {
        return null;
    }

    @Override
    public Product deleteProduct(String product_name) throws SQLException {
        return productDao.deleteProduct(product_name);
    }
}
